$class-prefix-tabs: rt-tabs;

.#{$class-prefix-tabs} {
  --title-font-size: var(--rt-size-14);
  --content-padding: 24px;
  --active-line-height: 2px;
  --active-line-border-radius: var(--active-line-height);
  --active-line-color: var(--rt-color-primary);
  --active-title-color: var(--rt-color-primary);

  position: relative;
  // Hack for auto scroll fail when the parent element is a flex layout
  min-width: 0;

  &-header {
    position: relative;
    border-bottom: solid 1px var(--rt-color-border);
  }

  &-header-mask {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
    width: 30px;
    height: 100%;
    pointer-events: none;
  }

  &-header-mask-left {
    left: 0;
    background: linear-gradient(
      to right,
      var(--rt-color-background),
      rgba(255, 255, 255, 0)
    );
  }
  
  &-header-mask-right {
    right: 0;
    background: linear-gradient(
      to left,
      var(--rt-color-background),
      rgba(255, 255, 255, 0)
    );
  }

  &-tab-list {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    overflow-x: scroll;
    &::-webkit-scrollbar {
      display: none;
    }
    scrollbar-width: none;
  }

  &-tab-line {
    position: absolute;
    bottom: 0;
    height: var(--active-line-height);
    background: var(--active-line-color);
    border-radius: var(--active-line-border-radius);
  }

  &-tab-wrapper {
    padding: 0 24px;
    &-stretch {
      // default: 0 1 auto; none: 0 0 auto; auto: 1 1 auto; 2: 2 1 0%; 0%: 1 1 0%; 24px: 1 1 24px; 2 3: 2 3 0%; 2 100px: 2 1 100px
      flex: auto;
    }
  }

  &-tab {
    // https://www.ruanyifeng.com/blog/2018/07/white-space.html
    white-space: nowrap;
    padding: 16px 0 20px;
    // https://www.jianshu.com/p/2f09204d96ad
    width: min-content;
    margin: 0 auto;
    font-size: var(--title-font-size);
    cursor: pointer;
  }

  &-tab-active {
    color: var(--active-title-color);
  }

  &-tab-disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  &-content {
    padding: var(--content-padding);
  }

}
